package com.itheima.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.common.DefaultException;
import com.itheima.dto.CommentDto;
import com.itheima.entity.Comment;
import com.itheima.vo.CommentVo;
import com.itheima.vo.comment.CommentChildVo;
import com.itheima.vo.comment.CommentParentVo;

import java.util.List;

/**
 * @author 51585
 * @description 针对表【comment】的数据库操作Service
 * @createDate 2022-10-21 14:35:48
 */
public interface CommentService extends IService<Comment> {

    /**
     * 发表评论
     *
     * @param commentDto
     * @return
     * @throws Exception
     */
    String sendComment(CommentDto commentDto) throws Exception;

    /**
     * 删除评论
     *
     * @param commentId
     * @return
     * @throws Exception
     */
    String deleteComment(Integer commentId) throws Exception;

    /**
     * 展示评论
     *
     * @param messageId
     * @return
     */
    List<CommentVo> showComment(Integer messageId);

    /**
     * 查看父级评论
     *
     * @param messageId 信息id
     * @return 父评论VO
     */
    List<CommentParentVo> parentComment(Integer messageId);

    /**
     * 查看子评论
     *
     * @param commentId 评论id
     * @return 子评论Vo
     * @throws DefaultException
     */
    List<CommentChildVo> childComment(Integer commentId) throws DefaultException;

}
